<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});
Route::get("/test/{id}/{name}",function($id,$name){
	echo $id;
	return "aaaa";
})->where("id","\d+");
Route::get("/ajax",function(){
	return view("ajax");
});
Route::post("/test",function(){
	//echo "aaa";
	dd($_POST);
});
Route::group(["middleware"=>"test1"],function(){
	Route::get("/test1",function(){
		echo "aaaaa";
	});
	Route::get("/test2",function(){
		echo "bbbbb";
	});
});
Route::get("/test3",function(){
	echo "test3";
})->middleware("test1");
Route::get("/user/index","UserController@index");
Route::get("/user/add",[
	"as"=>"add",
	"uses"=>"UserController@add"
	]);

Route::get("/user/edit/{id}","UserController@edit")->where("id","\d+");
Route::post("/user/update","UserController@update");
Route::get("/user/del/{id}","UserController@del")->middleware("test1")->where("id","\d+");
Route::get("/user/del/{id}/{name}",[
		"middleware"=>"test1",
		"uses"=>"UserController@del"
	])->where("id","\d+")->where("name","[a-zA-Z]+");
Route::controller("/good","GoodController");
Route::controller("/t","TestController");